import 'package:car_map/page/morepage/more_router.dart';
import 'package:car_map/page/routers/fluro_navigator.dart';
import 'package:flutter/material.dart';

///更多
class MorePage extends StatefulWidget{
  @override
  _morePagePage createState()=>_morePagePage();

}

class _morePagePage extends State<MorePage>{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('更多'),
        centerTitle: true,
      ),
      body: Center(
        child: ListView(
          children: <Widget>[
            _listTitle(title: '平台消息',iconData: Icons.insert_comment,callback: (){
              NavigatorUtils.push(context, MoreRouter.platformPage,
                  replace: false);
            }),

            _listTitle(title: '发布公告',iconData: Icons.assignment,callback: (){
              NavigatorUtils.push(context, MoreRouter.annoucePage,
                  replace: false);
            }),

            _listTitle(title: '系统设置',iconData: Icons.list,callback: (){
              NavigatorUtils.push(context, MoreRouter.settingPage,
                  replace: false);
            }),

            _listTitle(title: '后台管理',iconData: Icons.settings,callback: (){
              NavigatorUtils.push(context, MoreRouter.backstagePage,
                  replace: false);
            }),

            _listTitle(title: '离线地图',iconData: Icons.map),

            _listTitle(title: '意见反馈',iconData: Icons.assessment),

            _listTitle(title: '关于信息',iconData: Icons.assignment_late,callback: (){
              NavigatorUtils.push(context, MoreRouter.aboutPage,
                  replace: false);
            }),
            _listTitle(title: '账号信息',iconData: Icons.account_box,callback: (){
              NavigatorUtils.push(context, MoreRouter.accountPage,
                  replace: false);
            }),
          ],
        ),
      ),
    );
  }


  Widget _listTitle({String title,IconData iconData,GestureTapCallback callback}){
    return  Container(
      decoration: BoxDecoration(
        border: Border(
          bottom: BorderSide(
            color: Colors.black12,
            width: 0.5
          )
        )
      ),
      child: ListTile(
        title: Text(title),
        leading:Icon(iconData,color: Colors.blue,),
        trailing: Icon(Icons.navigate_next),
        onTap: callback,
      ),
    );
  }
}